package com.mvc4g.example.shareModel.client.action;

import com.mvc4g.client.ActionInterface;
import com.mvc4g.client.Controller;
import com.mvc4g.example.shareModel.client.Constants;
import com.mvc4g.example.shareModel.client.bean.BeanC;
import com.mvc4g.example.shareModel.client.view.templates.RootTemplate;
import com.mvc4g.example.shareModel.client.view.views.ViewC;

public class ShowCAction implements ActionInterface, Constants {

	@Override
	public void execute(Controller controller, Object form) {
		BeanC modelC = new BeanC();
		modelC.setInfo("C has information needed by B");

		ViewC viewC = (ViewC) controller.getView(VIEW_C);
		viewC.setModelC(modelC);

		RootTemplate rootView = (RootTemplate) controller
				.getView(ROOT_TEMPLATE);
		rootView.changeWidgetC(viewC);

	}

}
